import React, { Component } from 'react';

class Demo extends Component{
  constructor(props){
    // super(props);
    super();
    console.log(props);//{msg: "(*^_^*)"}
    console.log(this.props);// undefined
  }
  render(){
    return <h1>Demo 组件 {this.props.msg}</h1>
  }
}

class App extends Component {
  constructor(props){
    super(props);// ? 这个props 传给不传 有没有什么区别呢

  }
  render() {
    return (
      <div>
        <Demo msg="(*^_^*)"></Demo>
      </div>
    );
  }
}

export default App;
